import VueRouter from 'vue-router'
import Vue from 'vue'

Vue.use(VueRouter);

//导入路由组件
import children from '../component/children.vue'
import home from '../component/home.vue'

//定义路由
const routes = [
  {path:'/children',component:children},
  {path:'/home',component:home},
  {path:'*',redirect:'/home'}
];

//实例化vueRouter
const router = new VueRouter({
  routes
});

//导出router
export default router

